package com.roads.common.constant;

import io.jsonwebtoken.Claims;

/**
 * 通用常量信息
 *
 * @author nhp
 */
public class Constants {
    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * 是 Y
     */
    public static final String YES = "Y";

    /**
     * 否 N
     */
    public static final String NO = "N";

    /**
     * 首期
     */
    public static final String FIRST_PERIOD = "1";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 通用锁定标识
     */
    public static final String LOCK = "1";

    /**
     * 通用未锁定标识
     */
    public static final String UNLOCK = "0";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_TOKEN_KEY = "login_tokens:";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    /**
     * 限流 redis key
     */
    public static final String RATE_LIMIT_KEY = "rate_limit:";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 2;

    /**
     * 令牌
     */
    public static final String TOKEN = "token";

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";

    /**
     * 令牌前缀
     */
    public static final String LOGIN_USER_KEY = "login_user_key";

    /**
     * 用户ID
     */
    public static final String JWT_USERID = "userid";

    /**
     * 用户名称
     */
    public static final String JWT_USERNAME = Claims.SUBJECT;

    /**
     * 用户头像
     */
    public static final String JWT_AVATAR = "avatar";

    /**
     * 创建时间
     */
    public static final String JWT_CREATED = "created";

    /**
     * 用户权限
     */
    public static final String JWT_AUTHORITIES = "authorities";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    /**
     * 资源映射路径 前缀
     */
    public static final String RESOURCE_PREFIX = "/profile";

    /**
     * RMI 远程方法调用
     */
    public static final String LOOKUP_RMI = "rmi://";

    /**
     * LDAP 远程方法调用
     */
    public static final String LOOKUP_LDAP = "ldap://";

    /**
     * LDAPS 远程方法调用
     */
    public static final String LOOKUP_LDAPS = "ldaps:";

    /**
     * 定时任务白名单配置（仅允许访问的包名，如其他需要可以自行添加）
     */
    public static final String[] JOB_WHITELIST_STR = { "com.roads" };

    /**
     * 定时任务违规的字符
     */
    public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
            "org.springframework", "org.apache", "com.roads.common.utils.file" };

    /**
     * 机构类型-分包
     */
    public static final String INSTITUTION_TYPE_F = "F";

    /**
     * 机构类型-标段
     */
    public static final String INSTITUTION_TYPE_B = "B";

    /**
     * 机构类型-驻地
     */
    public static final String INSTITUTION_TYPE_D = "D";

    /**
     * 机构类型-监理
     */
    public static final String INSTITUTION_TYPE_J = "J";

    /**
     * 机构类型-总监
     */
    public static final String INSTITUTION_TYPE_Z = "Z";

    /**
     * 机构类型-代建办
     */
    public static final String INSTITUTION_TYPE_A = "A";

    /**
     * 机构类型-施工机构组合，包含B,F
     */
    public static final String INSTITUTION_TYPE_CONSTRUCTION = "B,F";

    /**
     * 机构类型-监理组合类型，包含D,J,Z
     */
    public static final String INSTITUTION_TYPE_SUPERVISOR = "D,J,Z";

    /**
     * 机构类型-业主
     */
    public static final String INSTITUTION_TYPE_Y = "Y";

    /**
     * 清单分隔符
     */
    public static final String BOQ_SEPARATOR = "-";

    /**
     * 菜单类型-工程计量
     */
    public final static Integer MENU_TYPE_ENGINEERING = 1;

    /**
     * 菜单类型-变更令申报
     */
    public final static Integer MENU_TYPE_CHANGE = 2;

    /**
     * 菜单类型-监理计量
     */
    public final static Integer MENU_TYPE_SUPERVISION = 3;

    /**
     * 菜单类型-代办计量
     */
    public final static Integer MENU_TYPE_AGENCY = 4;

    /**
     * 菜单类型-总体形象计划
     */
    public final static Integer MENU_TYPE_PROFILE_OVERALL = 5;

    /**
     * 菜单类型-年形象计划
     */
    public final static Integer MENU_TYPE_PROFILE_YEAR = 6;

    /**
     * 菜单类型-月形象计划
     */
    public final static Integer MENU_TYPE_PROFILE_MONTH = 7;

    /**
     * 菜单类型-形象进度
     */
    public final static Integer MENU_TYPE_PROFILE_SCHEDULE = 8;

    /**
     * 流程类型 1 工程计量
     */
    public final static String WORKFLOW_TYPE_ENGINEERING = "1";

    /**
     * 流程类型 2 监理计量
     */
    public final static String WORKFLOW_TYPE_SUPERVISION = "2";

    /**
     * 流程类型 3 代建计量
     */
    public final static String WORKFLOW_TYPE_AGENCY = "3";

    /**
     * 流程类型 4 计划进度-形象
     */
    public final static String WORKFLOW_TYPE_PROFILE = "4";

    /**
     * 支付项目固定值4
     */
    public final static Integer FIXED_VALUE = 4;

    /**
     * 消息状态：已处理
     */
    public final static String MESSAGE_STATUS_PROCESSED = "1";
    /**
     * 消息状态：未处理
     */
    public final static String MESSAGE_STATUS_UNTREATED = "0";

    /**
     * 消息类型：数据传送
     */
    public final static String MESSAGE_TYPE_DELIVERY = "1";

    /**
     * 监理清单类型-施工期
     */
    public static final String SUPERVISION_BOQ_TYPE_CONSTRUCTION = "1";

    /**
     * 监理清单类型-冬休期
     */
    public static final String SUPERVISION_BOQ_TYPE_WINTER = "2";

    /**
     * 监理清单类型-缺陷责任期
     */
    public static final String SUPERVISION_BOQ_TYPE_DEFECT = "3";

}